import java.util.HashMap;
import java.util.Map;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 殇
 * Date: 2025-07-23
 * Time: 16:31
 */
public class Test2 {
    public static int getAvg(int num){
        int sum=0;
        for(int i=1;i<num;i++){
            if(num%i==0)
                sum+=i;
        }
        return sum;
    }

    public static boolean isPower(int n){
        if(n==1)
            return true;
        int tmp=n;
        while(tmp>0){
            if(tmp%2!=0)
                return false;
            tmp/=2;
        }
        return true;
    }

    public static int[] findNumberAppearOnce(int[] arr) {
        int[] ret=new int[2];
        int index=0;
        Map<Integer,Integer> map=new HashMap<>();
        for(int i=0;i<arr.length;i++){
            if(map.containsKey(arr[i])==true){
                map.put(arr[i],map.get(arr[i])+1);
            }
            else
                map.put(arr[i],1);
        }

        for (Map.Entry<Integer, Integer> entry : map.entrySet()) {
            if(entry.getValue()==1)
                ret[index++]=entry.getKey();
        }
        return ret;

    }

    public static void main(String[] args) {
        for(int i=1;i<=1000;i++){
            int j=0;
            for(int t=1;t<i;t++){
                if(i%t==0)
                    j+=t;
            }
            if(j>=1&&j<=1000) {
                int k = 0;
                for(int t=1;t<j;t++){
                    if(j%t==0)
                        k+=t;
                }
                if (k==i&&i!=j&&i<j)
                    System.out.println(i+"和"+j+"是一对相亲数");
            }
        }

        //-------------------------------------------
        int[] arr=new int[]{3,2,1,7,6,4,3,4,1,7};
        int[] ret=findNumberAppearOnce(arr);
        for(int i=0;i<ret.length;i++){
            System.out.print(ret[i]+" ");
        }
    }
}
